package com.t9101DR;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

import java.io.FileWriter;
import java.io.IOException;
import java.sql.Connection;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117657448";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key ="MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCYdPGIwCcvNBvcBctTiBgnngbL8+ke1GlO59qGSjHb2bcu7jsH2tEoZjioD2Ggo2pvkfWqESbdBCxm7GKJq0knlkRqwtzXWVEgJQy59EHsNOjai9Gh02wAZP2E5tgMSu4+YRIkNM7/LGbnmWZ0pax2TBCdpUtdu56XbFYFewORxqcr9KRAuOcLsuvNolkNYv5Cn/yWYCIICQlP8HYMkoLU457kLEumbi5wD61gVZE1pZXqzfKbW0RV3wlO0YznTiVzVXRm6Zy8XYgE6UOSpmcRnkUCc9CCGyA0jI/Dzrvowj/W+5x5Y/mEdvM8o2hSfpTzniTVkqJZfjcuv/+ZskKFAgMBAAECggEAWrLv4uhWJ3n7vQjhbt9/Z0pXRszj+ohp4hyDX/MR+HZsyYnHKqQeXMd7m1gTP6sYrimKmlO76C8Mb2rgMIDrc5atO0qUcbVcUyBXkuVitrC/ew1FeN272fw66u8exylo1UmQrmOQZjS3P79+OZU6peIY3ICy9p+g+PrlrjsB4536G0KVp9IKTlkYho5vue7hqBuUDnZzOfIKepPhaiiHuTMv0qkjhz9nouDRHESAE5s7zIYBssH1z8H7iG7MLvtk3yfic8pyc6jd+nfN2aD0lxZ7E0akBvQVq2FyMirfvDSwcFeAgyzSm8rDsfIdxM4RZalSN7fB4Lgz0vo+SYpTnQKBgQDpFlO7FOSVXvdWr8jszqhs9XfwNbP/fHGASvEJEYzPd8zOGL/oL2VCvJb+DwLB/x+qFkft6pMBlooiVVOzFYthoul8VM+E8MCYvZJlcOGXPLyYxfY64Zxd133aJgOV5jx+WCesffw1abCFOHGWdhX60dCESlfsXP90WDYePVbuvwKBgQCncYpzAfQmY7C/3qwEdF5fA0gGAiVFtBAOnpe/1FsQvWYtmvrjYV/LrVKdkcBND9qsAQ4aU7FBpxkarBOrM9o00TK5GUkmSSU6AOu/pmBHcXqlNKwg6Bider95amocYjZAQ5wkEmdXNfSp/DLR1dFExRSm34lO2gsGqBcw6KJjuwKBgQC/BgtNEUxcll3Cb4INgThLQ8kt1fVUdtpWOBTeR8HM7fOtHF96nA0y6ngccpTiBIIg1O3SMCKWdJd0l9VmuUtnkyojOSZxXxWYmBR4ilB3r9Eoq2Sm0OtjhQ2hUPIzUWNWcEzjcsTVyW5fX+jHVLOiwX1QTdVM4tKAuSJxGfg65QKBgBiWFGU0uTvV0YMq2AlDaQP8gFvZfs2QVfc/lDqnnMOFe/ZgVkyC5MUMayAV4a2vEUXGVeLJvTJNreL7t1uhHn445YDGVLZZcSzmK7eVX3e+EuslI80lJ1AgUPMsC+6lASBIjSnCxgfJNWasUG39PmAhrBmgoxG/9HSCw/z7e7S3AoGBAMPlHk0N1Y7q0UROBI/uyFh+pLFo4MMhNewLozuK63O9LuImjsYyMkUaOd5chCBlYYFZ/uwImcmR+plJz7z3PaL0N0tnLHRRYy3xZNmyPHW08ibCn0vByofNflUmiTQljlT0LguDa97yKP9kY6GZ22QuprK3ltUsyrzV5fZyV10a";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmHTxiMAnLzQb3AXLU4gYJ54Gy/PpHtRpTufahkox29m3Lu47B9rRKGY4qA9hoKNqb5H1qhEm3QQsZuxiiatJJ5ZEasLc11lRICUMufRB7DTo2ovRodNsAGT9hObYDEruPmESJDTO/yxm55lmdKWsdkwQnaVLXbuel2xWBXsDkcanK/SkQLjnC7LrzaJZDWL+Qp/8lmAiCAkJT/B2DJKC1OOe5CxLpm4ucA+tYFWRNaWV6s3ym1tEVd8JTtGM504lc1V0ZumcvF2IBOlDkqZnEZ5FAnPQghsgNIyPw8676MI/1vuceWP5hHbzPKNoUn6U854k1ZKiWX43Lr//mbJChQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/pay_war_exploded/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:9101/DR/Home.jsp";
    
    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl ="https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "https://openapi.alipaydev.com/gateway.do";
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
    	
    	
    	
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
            
            
            
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
